<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/StakeholderTTATemplate.xhtml">

    <ui:define name="contentInsert">
        <c:if test="#{checkBIPaymentMB.checkIsPaid()}">
            <h:outputText style="color: #D20005; font-family: verdana; font-weight: bold;
                          font-size: small;"
                          value="Local Customer loyalty index is calculated using this function: "/> <br/>
            <h:outputText style=" font-family: sant-serif; font-size: medium;"
                          value="idx = 12 * x - y "/> <br/>
            <h:outputText style=" font-family: sant-serif; font-size: small;"
                          value="x: average number of visits per month "/> <br/>
            <h:outputText style=" font-family: sant-serif; font-size: small;"
                          value="y: number of months elapsed since his last visit "/> <br/>
            <h:panelGrid columns="5">
                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="idx >= 6"/>
                &nbsp;
                <p:graphicImage value="/ttaImage/arrowGreen.jpg" height="9px" width="20px"/>
                &nbsp;
                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="Rank = 1 "/> 


                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="idx >= 3 "/> 
                &nbsp;
                <p:graphicImage value="/ttaImage/arrowGreen.jpg" height="9px" width="20px"/>
                &nbsp;
                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="Rank = 2 "/> 


                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="idx >= 0 "/> 
                &nbsp;
                <p:graphicImage value="/ttaImage/arrowGreen.jpg" height="9px" width="20px"/>
                &nbsp;
                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="Rank = 3 "/>


                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="idx &lt; 0"/> 
                &nbsp;
                <p:graphicImage value="/ttaImage/arrowGreen.jpg" height="9px" width="20px"/>
                &nbsp;
                <h:outputText style=" font-family: sant-serif; font-size: small;"
                              value="Rank = 4 "/> 
            </h:panelGrid>
            <h:form>
                <p:dataTable value="#{stakeholderCustAnalysisMB.sortedLocalLoyaltyIdx}" var="cust"
                             emptyMessage="there are no local customers exist for this stakeholder..."
                             rows="30" paginator="true">
                    <p:column headerText="CustomerID">
                        #{cust.customerId}
                    </p:column>
                    <p:column headerText="CustomerEmail">
                        #{cust.customerEmail}
                    </p:column>
                    <p:column headerText="Loyalty Index">
                        #{cust.loyaltyIndexStr}
                    </p:column>
                    <p:column headerText="Rank" filterBy="#{cust.rank}">
                        #{cust.rank}
                    </p:column>
                </p:dataTable>
            </h:form>
        </c:if>
    </ui:define>
</ui:composition>